@tailwind base;
@tailwind components;
@tailwind utilities;

:host {
  --root-size: 14px; /* 默认值 */
}

@media (min-width: 768px) {
  :host {
    --root-size: 16px; /* PC 端的值 */
  }
}

#crab-root {
  color: #000;
  font-family: monospace, sans-serif;
  font-size: clac(var(--root-size) / 2);
}
/* 
#crab-root .btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  z-index: 2047;
  display: flex;
  align-items: center;
} */

.btn svg {
  width: 100%;
  height: 100%;
}

.crab-icon {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* #crab-root .text-md {
  font-weight: bold;
  font-size:calc(var(--root-size) - 2px);
} */

/* #crab-root .text-sm {
  font-size: calc(var(--root-size) - 4px);
} */

#crab-root .crab-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2048;
}

#crab-root .crab-dialog  .crab-dialog-inner-content {
  width: 100%;
  min-height: calc(var(--root-size) * 4);
}

#crab-root .crab-dialog .crab-dialog-inner {
  min-width: calc(var(--root-size) * 20);
  max-width: 70%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
}

#crab-root .crab-dialog .crab-dialog-inner .crab-dialog-inner-header {
  width: 100%;
  display: flex;
  align-items: center;
  padding: calc(var(--root-size) / 2);
  box-sizing: border-box;
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
}


#crab-root .crab-dialog .crab-dialog-inner .crab-dialog-inner-header .close-icon svg {
  fill: rgb(102, 114, 142);
}

#crab-root .crab-sliderbar {
  position: absolute;
  right: calc(var(--root-size) * 4);
  bottom: 0;
  z-index: 2047;
  background-color: #fff;
  border-radius: 5px;
  opacity: 0;
  box-shadow: 0px 5px 10px 5px rgba(0, 0, 0, 0.1);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
}

.show {
  opacity: 1;
  transition: opacity 500ms ease-in-out;
  -webkit-transition: opacity 500ms ease-in-out;
  -moz-transition: opacity 500ms ease-in-out;
  -ms-transition: opacity 500ms ease-in-out;
  -o-transition: opacity 500ms ease-in-out;
}

#crab-root .crab-sliderbar .item span {
  margin-right: calc(var(--root-size) / 8);
}

#crab-root .crab-sliderbar .item {
  width: max-content;
  display: flex;
  align-items: center;
  padding: calc(var(--root-size) / 3) calc(var(--root-size) / 2);
}

#crab-root .crab-sliderbar .item:hover {
  background-color: rgb(130 159 238 / 0.1);
  transition: all 500ms ease;
  -webkit-transition: all 500ms ease;
  -moz-transition: all 500ms ease;
  -ms-transition: all 500ms ease;
  -o-transition: all 500ms ease;
}


#crab-root .crab-setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--root-size) / 2);
}


#crab-root .crab-setting .setting-item {
  /* margin-right: calc(var(--root-size) / 2); */
  /* width: calc(var(--root-size) * 3); */
  width: 100%;
  padding: 0 calc(var(--root-size) / 2);
  margin-bottom: calc(var(--root-size) / 2);
}

#crab-root .crab-setting .setting-item label {
  margin-bottom: calc(var(--root-size) / 2);
}

#crab-root .crab-setting .server-url {
  flex: 1;
}

#crab-root .crab-setting input {
  outline: none;
  border: 1px solid #dcdee2;
  color: #515a6e;
  cursor: text;
  padding: calc(var(--root-size) / 2);
  width: 100%;
  box-sizing: border-box;
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
}

#crab-root .crab-setting input:focus {
  border-color: rgb(130, 159, 238);
  box-shadow: 0 0 2px rgb(130 159 238 / 0.2)
}

#crab-root .crab-setting  input::-webkit-input-placeholder{
  color: #c5c8ce;
}

#crab-root .crab-media-list {
  display: flex;
  flex-direction: column;
  padding: calc(var(--root-size) / 2);
  max-height: calc(var(--root-size)* 20);
  overflow-y: auto;
}

#crab-root .crab-media-list .crab-media {
  display: flex;
  align-items: center;
  padding: calc(var(--root-size) /2);
  border-bottom: 1px solid #e0e3e9;
}

#crab-root .crab-media-list .crab-media .url {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: calc(var(--root-size) /2);
  font-size: calc(var(--root-size) - 4px);
}

#crab-root .crab-media-list .crab-media .type {
  width: calc(var(--root-size) * 4);
  font-size: calc(var(--root-size) - 4px);
  padding-right: calc(var(--root-size) /2);
}

#crab-root .crab-media-list .crab-media .duration {
  width: calc(var(--root-size) * 8);
  font-size: calc(var(--root-size) - 4px);
}

/* #crab-root .crab-media-list .crab-media button {
  outline: none;
  border: none;
  margin-left: calc(var(--root-size) /2 );
  background-color: rgba(130, 159, 238, 0.8);
  color: #fff;
  font-size: calc(var(--root-size) - 4px);
  padding: calc(var(--root-size) / 2) ;
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
} */



.select {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.select-title {
  position: relative;
  width: 100%;
  border: 1px solid #dcdee2;
  color: #515a6e;
  padding: calc(var(--root-size) / 2);
  box-sizing: border-box;
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  box-sizing: border-box;
  cursor: pointer;
}

.select-title::after {
  position: absolute;
  top: 0;
  right: 5px;
  width: 20px;
  height: 100%;
  line-height: 40px;
  text-align: center;
  content: "";
  background-image: url("");
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center;
}

.select-list {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  padding-left: 0px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.select-item {
  width: 100%;
  height: 40px;
  line-height: 40px;
  list-style: none;
  padding: 0 10px;
  cursor: pointer;
  box-sizing: border-box;
}

.select-item:hover {
  background-color: #eee;
}
